function a(index) {
  console.log(`index:${index}`)
  return () => {
    return new Promise((resolve, reject) => {
      setTimeout(() => {
        console.log(`resolve index:${index}`)
        resolve()
      }, 5000)
    })
  }
}

async function main() {
  await a(1)()
  await a(1)()
}

main()
